package com.awn.weidian.demo.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import com.awn.weidian.demo.pojo.Areamenu;

/**
 * 地区接口，完成对地区信息的查询
 * @author "liyi"
 *
 */
@Mapper
public interface AreaMenu {
	
	/**
	 * 返回所有的地省信息
	 * @return
	 */
	@Select("select * from region where father = 0")
	public List<Areamenu> getShengList();
	
	/**
	 * 返回所有的市信息
	 * @return
	 */
	@Select("select * from region where father in(select rid from region where father = 0 and rname !='中国')")
	public List<Areamenu> getShiList();
	
	/**
	 * 返回所有的县信息
	 * @return
	 */
	@Select("select * from region where father in(select rid from region where father in(select rid from region where father = 0 and rname !='中国'))")
	public List<Areamenu> getXianList();
	
	/**
	 * 返回所有的地区信息
	 * @return
	 */
	@Select("select * from region")
	public List<Areamenu> getObjectMapList();
}
